package com.coinland.study.util;

/**
 * 类描述:  工具类-- 防止重复点击
 * 创建人:  shenZ
 * 创建时间: 2020/4/22
 * 联系方式: 252079249@qq.com
 * 修改时间: 2020/4/22
 */
public class Utils {
    // 两次点击按钮之间的点击间隔不能少于500毫秒
    private static final int MIN_CLICK_DELAY_TIME = 500;
    private static long lastClickTime;

    public static boolean isFastClick() {
        boolean flag = false;
        long curClickTime = System.currentTimeMillis();
        if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) {
            flag = true;
        }
        lastClickTime = curClickTime;
        return flag;
    }
}
